-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add autoflake in precommit check #11619
Conversation
1e78130
to
f50ba88
Compare
Can you take a look at the checks once |
- "--expand-star-imports" | ||
- "--remove-duplicate-keys" | ||
- "--remove-unused-variables" | ||
- "--remove-all-unused-imports" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you try configuring autoflake in pyproject.toml
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In CI chcks, One of the autoflake plugin trying to remove pass
keyword from code which is not necessary to remove as they are placeholders and required to function the functions properly !
Please rectify the issue!
There is nothing to rectify @jyejare. |
Agree but using pass is a common behavior in programmers and that also tells it is not implemented. I really dont see we should have any checks to remove it. Probably we can ignore that check from the hook. |
Agreed, using PEP 257 states
That means that if the function has Also, There is a nice thread on this topic on Stack Overflow. Since autoflake is developed by PyCQA, I would trust them and go with what their tools suggest. |
@ogajduse Sure! And thanks for the nice explanation! Well still I will keep my NACK to fix the files which has |
Note, broker is doing the same with unnecessary |
About |
@lhellebr I perhaps did not study it deeper. I do not have a strong opinion on whether to use Ellipsis or |
This pull request has not been updated in the past 45 days. |
What's the status here? From reading the comments, I wasn't able to identify what's blocking progress. Are we waiting for @shweta83 to fix the style checks? |
I am in favor of closing this PR as there is a plan to include ruff into our workflow in robottelo in the same way as in broker, nailgun, and airgun. |
Ruff added as a part of #12621 |
@shweta83 We should now close this as we have ruff in place now! Thanks for all your efforts though 👍 |
Why do we need it? Existing pre-commit checks doesn't remove unused imports and variables from the code. With autoflake, it remove these unused imports and variables in-place and avoids the manual effort.